#include "widget.h"
#include "ui_widget.h"

#include"timethread.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(&t,&TimeThread::sendTime,this,&Widget::showtime);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::showtime(QString Time)
{
     qDebug()<<"begin start";
    ui->label->setText(Time);
}

//void Widget::button_clicked()
//{
//    //开启线程
//    qDebug()<<"click button";
//    t.start();
//}


void Widget::on_pushButton_clicked()
{
    t.start();
}
